package com.ruoyi.production.service.impl.pesticide;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.pesticide.PesticideAmountMapper;
import com.ruoyi.production.domain.pesticide.PesticideAmount;
import com.ruoyi.production.service.pesticide.IPesticideAmountService;

/**
 * 农药量Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class PesticideAmountServiceImpl implements IPesticideAmountService
{
    @Autowired
    private PesticideAmountMapper pesticideAmountMapper;

    /**
     * 查询农药量
     *
     * @param pesticideAmountId 农药量ID
     * @return 农药量
     */
    @Override
    public PesticideAmount selectPesticideAmountById(Long pesticideAmountId)
    {
        return pesticideAmountMapper.selectPesticideAmountById(pesticideAmountId);
    }

    /**
     * 查询农药量列表
     *
     * @param pesticideAmount 农药量
     * @return 农药量
     */
    @Override
    public List<PesticideAmount> selectPesticideAmountList(PesticideAmount pesticideAmount)
    {
        return pesticideAmountMapper.selectPesticideAmountList(pesticideAmount);
    }

    /**
     * 新增农药量
     *
     * @param pesticideAmount 农药量
     * @return 结果
     */
    @Override
    public int insertPesticideAmount(PesticideAmount pesticideAmount)
    {
        pesticideAmount.setCreateTime(DateUtils.getNowDate());
        return pesticideAmountMapper.insertPesticideAmount(pesticideAmount);
    }

    /**
     * 修改农药量
     *
     * @param pesticideAmount 农药量
     * @return 结果
     */
    @Override
    public int updatePesticideAmount(PesticideAmount pesticideAmount)
    {
        pesticideAmount.setUpdateTime(DateUtils.getNowDate());
        return pesticideAmountMapper.updatePesticideAmount(pesticideAmount);
    }

    /**
     * 批量删除农药量
     *
     * @param pesticideAmountIds 需要删除的农药量ID
     * @return 结果
     */
    @Override
    public int deletePesticideAmountByIds(Long[] pesticideAmountIds)
    {
        return pesticideAmountMapper.deletePesticideAmountByIds(pesticideAmountIds);
    }

    /**
     * 删除农药量信息
     *
     * @param pesticideAmountId 农药量ID
     * @return 结果
     */
    @Override
    public int deletePesticideAmountById(Long pesticideAmountId)
    {
        return pesticideAmountMapper.deletePesticideAmountById(pesticideAmountId);
    }
}
